#ifndef DRV_PI_H
#define DRV_PI_H

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "main.h"

#define FILTER_TIMES 5
typedef enum {
    ePi_0,      //DPI24
    ePi_1,      //DPI25
    ePi_2,      //DPI26
    ePi_3,      //DPI27
    ePi_4,      //DPI28
    ePi_5,      //DPI29
    ePi_6,      //DPI30
    ePi_7,      //DPI31
    ePiNumer
}PI_NUMBER_t;



extern void drv_pi_init(void);

extern uint32_t get_pi_frequency(uint8_t ch);

extern float g_pi_frequency[ePiNumer];
extern float g_pi_duty[ePiNumer];
extern uint32_t g_pi_disconnect_cnt[ePiNumer];

/**
 * @brief 获取PI计数
 * [param in] ch 0~8 分别对应IN26~IN33
 * [param out] 上升沿的个数
*/
extern uint32_t get_pi_count(uint8_t ch);
#endif


